<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <h1>打开控制台看输出</h1>
    <script>
      // function 函数声明
      function fn() {
        alert("我是函数");
      }
      // fn();

      // 匿名函数
      const fn2 = function () {
        alert("我是匿名函数");
      };
      // fn2();

      // 箭头函数
      const fn3 = () => {
        alert("我是箭头函数");
      };
      // fn3();

      const sayHi = (params) => {
        console.log(params);
      }
      // sayHi('hello')
      // sayHi(['hello','12','23'])

      const fn4 = (a,b,...params) => {
        console.log(params);
      }
      fn4(1,2,3,4)
    </script>
  </body>
</html>
